package org.ix.shiro.controller;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {

    @GetMapping("/add")
    @RequiresPermissions("user:add")
    public ResponseEntity<String> addUser() {
        return ResponseEntity.ok("add user");
    }

    @GetMapping("/update")
    @RequiresPermissions("user:update")
    public ResponseEntity<String> updateUser() {
        return ResponseEntity.ok("update user");
    }

    @GetMapping("/del")
    @RequiresPermissions("user:del")
    public ResponseEntity<String> delUser() {
        return ResponseEntity.ok("del user");
    }
}
